<?php
include_once(root.'/library/mysqlhelper.php');
include_once root.'/model/dicthelper.php';
class AreaList extends MySqlHelper {
    public function __construct() {
        parent::__construct("area_list");
    }
}

class AreaDict extends DictDataHelper
{
    public static function CreateJson()
    {
        $json='if (!window.dictdata) var dictdata={};'."\n";
        $entity=new AreaList();
        $entity->select('id,mingcheng,parentid')->query();
        $json.='dictdata["area"]='.$entity->toArray().";\n";

        FileExtend::MakeFile(root.'/data/area.js',$json);
    }
}
?>